package com.teensoft.core.user.imp;

import com.teensoft.base.dao.imp.HibernateDAO;
import com.teensoft.base.exception.DAOException;
import com.teensoft.core.user.Permission;
import com.teensoft.core.user.PermissionDAO;

public class PermissionDAOImp extends HibernateDAO implements PermissionDAO {

	public void addPermission(Permission permission) throws DAOException {
		this.saveOrUpdate(permission);
	}

	public void deletePermissionById(String id) throws DAOException {
		this.delete(Permission.class, id);
	}

	public Permission getById(String id) throws DAOException {
		return (Permission)this.get(Permission.class, id);
	}

	public void updatePermission(Permission permission) throws DAOException {
		this.saveOrUpdate(permission);
	}

}
